Fix NoMethodError when status.exitstatus is nil#700
Merged
rosa merged 1 commit intorails:mainfrom Jan 11, 2026
Merged
Conversation
When a worker process is terminated by certain signals (e.g., SIGKILL), status.exitstatus returns nil, causing a NoMethodError due to operator precedence in the conditional. This fix: 1. Adds parentheses to ensure proper evaluation order 2. Uses .to_i to safely convert nil to 0, preventing the NoMethodError Fixes the error: NoMethodError: undefined method '>' for nil
rosa
approved these changes
Jan 11, 2026
Member
rosa
left a comment
There was a problem hiding this comment.
Ohh, great catch! I wonder why I've never hit this error 🤔 Sending a SIGKILL to processes is the way I've usually been testing this 😅 Do you know how you triggered it exactly?
Contributor
Author
|
Thanks for merging! Since deploying Solid Queue 1.3.0 I noticed this crop up when I did a deploy on Render. It looks like Render sends a SIGTERM and then sends a SIGKILL after that, if the process isn't running (you can read more at https://render.com/docs/deploys#sequence-of-events). My guess it that this code was a problem on SIGTERM, but I didn't fully instrument to see which signal was causing the issue. I was surprised to learn that Process#exitstatus could return nil |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When a worker process is terminated by certain signals (e.g., SIGTERM, SIGKILL), status.exitstatus returns nil, causing a NoMethodError due to operator precedence in the conditional.
This fix:
Fixes the error: NoMethodError: undefined method '>' for nil